#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;

int s[35];
int main(void)
{
	int n, k;
	float avg;
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> s[i];
	} 
	cin >> k;
	sort(s, s+n, greater<int>());
	for(int i = 0; i < k; i++) {
		avg += s[i]; 
	}
	avg /= k;
	printf("%.2f", avg);
	return 0;
	
}
